$(document).ready(function(){
    $('#agree-btn').click(function(e){
        e.preventDefault();
        submit('agree');
    });

    $('#reject-btn').click(function(e){
        e.preventDefault();
        var c = confirm('确认驳回申请？');
        if (c) {
            submit('reject');
        }
    });

    function submit(result){
        $('#approval-result').val(result);
        $('#approval-form').submit();
    }

    if(message){
        alert(message);
    }

    if(reload_page){
        location.href = location.href;
    }
});
